package com.cyzy.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cyzy.dao.ClassTeacherDao;
import com.cyzy.dao.TeacherEvaluationDao;
import com.cyzy.mapper.TeacherMapper;
import com.cyzy.pojo.Teacher;
import com.cyzy.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl extends ServiceImpl<TeacherMapper,Teacher> implements TeacherService{

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public Page<TeacherEvaluationDao> selectTeacher(TeacherEvaluationDao teacherEvaluationDao) {
        Page<TeacherEvaluationDao> page = new Page<>(teacherEvaluationDao.getPageNum(), teacherEvaluationDao.getPageSize());
        return teacherMapper.selectTeacherList(page, teacherEvaluationDao,teacherEvaluationDao.getTeacherId(),teacherEvaluationDao.getCourseId());
    }

    @Override
    public List<Teacher> getTeacher(Teacher teacher) {
        return teacherMapper.getAllTeacherByTeacherId(teacher);
    }

    @Override
    public List<ClassTeacherDao> showTeacher(ClassTeacherDao classTeacherDao) {
        return teacherMapper.showTeacherByClassId(classTeacherDao);
    }
}
